<script setup lang="ts">
uni.showModal = (
  options: UniNamespace.ShowModalOptions,
): Promise<UniApp.ShowModalRes> => {
  return new Promise<UniApp.ShowModalRes>((resolve) => {
    my.showModal({
      cancelColor: '#666666',
      confirmColor: '#ff2f3b',
      ...options,
      success: (res) => {
        options?.success?.(res);
        resolve(res);
      },
    });
  });
};

// #ifdef MP
const updateManager = uni.getUpdateManager();
updateManager.onUpdateReady(() => {
  uni.showModal({
    title: '更新提示',
    content: '新版本已经准备好，是否重启小程序？',
    success (res) {
      if (res.confirm) {
        updateManager.applyUpdate();
      }
    },
  });
});
// #endif
</script>

<style lang="scss">
// @import '@/styles/global.scss';

page {
  color: var(--primary-text-color);
  font-size: 26rpx;
  // 按钮主题色
  --wot-button-primary-bg-color: #ff2f3b;
  // checkbox的勾选背景色
  --wot-checkbox-checked-color: #ff2f3b;
  --wot-checkbox-border-color: #cccccc;
  --wot-color-white: transparent;
  --wot-checkbox-check-color: #ffffff;
  // tabs滑动条的颜色
  --wot-tabs-nav-line-bg-color: #ff2f3b;
  // loadmore的错误颜色
  --wot-loadmore-error-color: #ff2f3b;
  // input-number 圆角
  --wot-input-number-radius: 50%;
  // picker
  --wot-cell-wrapper-padding: 0;
  --wot-size-side-padding: 0;
  // 输入框背景色
  --wot-input-bg: transparent;
  --wot-divider-line-color: transparent;
  .wd-tabs__nav-item {
    padding: 0 16rpx !important;
  }
}
</style>
